.class public Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;
.super Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;
.source "TextDecorationItem.java"


# static fields
.field private static n:I

.field private static o:I

.field private static p:I


# instance fields
.field private j:Ljava/lang/String;

.field private k:Landroid/text/TextPaint;

.field private l:Landroid/text/StaticLayout;

.field private m:Lcom/esfile/screen/recorder/videos/edit/activities/caption/font/a;


# direct methods
.method public constructor <init>(II)V
    .locals 0

    int-to-float p1, p1

    int-to-float p2, p2

    .line 1
    invoke-direct {p0, p1, p2}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;-><init>(FF)V

    .line 2
    sget p1, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->n:I

    if-nez p1, :cond_0

    .line 3
    invoke-static {}, Les/c5;->a()Landroid/content/Context;

    move-result-object p1

    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    .line 4
    sget p2, Les/v4;->durec_text_decor_default_text_size:I

    invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result p2

    sput p2, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->n:I

    .line 5
    sget p2, Les/v4;->durec_text_decor_min_text_size:I

    invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result p2

    sput p2, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->o:I

    .line 6
    sget p2, Les/v4;->durec_text_decor_max_text_size:I

    invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result p1

    sput p1, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->p:I

    .line 7
    :cond_0
    new-instance p1, Landroid/text/TextPaint;

    invoke-direct {p1}, Landroid/text/TextPaint;-><init>()V

    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    .line 8
    sget p2, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->n:I

    int-to-float p2, p2

    invoke-virtual {p1, p2}, Landroid/text/TextPaint;->setTextSize(F)V

    .line 9
    iget-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    const/4 p2, 0x1

    invoke-virtual {p1, p2}, Landroid/text/TextPaint;->setAntiAlias(Z)V

    return-void
.end method

.method public constructor <init>(Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;)V
    .locals 2

    .line 10
    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;-><init>(Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;)V

    .line 11
    new-instance v0, Landroid/text/TextPaint;

    invoke-direct {p1}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->q()Landroid/graphics/Paint;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/text/TextPaint;-><init>(Landroid/graphics/Paint;)V

    iput-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    .line 12
    invoke-virtual {p1}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->m()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->a(Ljava/lang/String;)V

    .line 13
    invoke-virtual {p1}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->p()Lcom/esfile/screen/recorder/videos/edit/activities/caption/font/a;

    move-result-object p1

    invoke-virtual {p0, p1}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->a(Lcom/esfile/screen/recorder/videos/edit/activities/caption/font/a;)V

    return-void
.end method

.method private b(FZ)V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    invoke-virtual {v0}, Landroid/text/TextPaint;->getTextSize()F

    move-result v0

    mul-float v0, v0, p1

    if-eqz p2, :cond_1

    .line 2
    sget p2, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->p:I

    int-to-float p2, p2

    cmpg-float p2, v0, p2

    if-gtz p2, :cond_0

    sget p2, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->o:I

    int-to-float p2, p2

    cmpl-float p2, v0, p2

    if-ltz p2, :cond_0

    goto :goto_0

    :cond_0
    const-string p1, "TextDecorationItem"

    const-string p2, "the font size is not rightful which must between sMaxFontSize and sMinFontSize"

    .line 3
    invoke-static {p1, p2}, Lcom/esfile/screen/recorder/utils/n;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    .line 4
    :cond_1
    :goto_0
    invoke-super {p0, p1}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;->a(F)V

    .line 5
    iget-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    invoke-virtual {p1, v0}, Landroid/text/TextPaint;->setTextSize(F)V

    .line 6
    invoke-direct {p0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->r()V

    :goto_1
    return-void
.end method

.method private c(Landroid/graphics/Canvas;)V
    .locals 1

    .line 2
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->l:Landroid/text/StaticLayout;

    if-eqz v0, :cond_0

    .line 3
    invoke-virtual {v0, p1}, Landroid/text/StaticLayout;->draw(Landroid/graphics/Canvas;)V

    :cond_0
    return-void
.end method

.method private q()Landroid/graphics/Paint;
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    return-object v0
.end method

.method private r()V
    .locals 9

    .line 1
    new-instance v8, Landroid/text/StaticLayout;

    iget-object v1, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->j:Ljava/lang/String;

    iget-object v2, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    .line 2
    invoke-static {v1, v2}, Landroid/text/Layout;->getDesiredWidth(Ljava/lang/CharSequence;Landroid/text/TextPaint;)F

    move-result v0

    float-to-int v3, v0

    sget-object v4, Landroid/text/Layout$Alignment;->ALIGN_NORMAL:Landroid/text/Layout$Alignment;

    const/high16 v5, 0x3f800000    # 1.0f

    const/4 v6, 0x0

    const/4 v7, 0x1

    move-object v0, v8

    invoke-direct/range {v0 .. v7}, Landroid/text/StaticLayout;-><init>(Ljava/lang/CharSequence;Landroid/text/TextPaint;ILandroid/text/Layout$Alignment;FFZ)V

    iput-object v8, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->l:Landroid/text/StaticLayout;

    .line 3
    invoke-virtual {v8}, Landroid/text/StaticLayout;->getWidth()I

    move-result v0

    int-to-float v0, v0

    invoke-virtual {p0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;->c()F

    move-result v1

    const/high16 v2, 0x40000000    # 2.0f

    mul-float v1, v1, v2

    add-float/2addr v0, v1

    iput v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;->d:F

    .line 4
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->l:Landroid/text/StaticLayout;

    invoke-virtual {v0}, Landroid/text/StaticLayout;->getHeight()I

    move-result v0

    int-to-float v0, v0

    invoke-virtual {p0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;->c()F

    move-result v1

    mul-float v1, v1, v2

    add-float/2addr v0, v1

    iput v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;->e:F

    return-void
.end method


# virtual methods
.method public a(F)V
    .locals 1

    const/4 v0, 0x1

    .line 1
    invoke-direct {p0, p1, v0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->b(FZ)V

    return-void
.end method

.method public a(FZ)V
    .locals 1

    if-eqz p2, :cond_0

    .line 7
    sget p2, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->p:I

    int-to-float p2, p2

    cmpg-float p2, p1, p2

    if-gtz p2, :cond_0

    sget p2, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->o:I

    int-to-float p2, p2

    cmpl-float p2, p1, p2

    if-ltz p2, :cond_0

    return-void

    .line 8
    :cond_0
    iget-object p2, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    invoke-virtual {p2}, Landroid/text/TextPaint;->getTextSize()F

    move-result p2

    div-float p2, p1, p2

    .line 9
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    invoke-virtual {v0, p1}, Landroid/text/TextPaint;->setTextSize(F)V

    .line 10
    invoke-virtual {p0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;->c()F

    move-result p1

    mul-float p2, p2, p1

    invoke-virtual {p0, p2}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;->h(F)V

    .line 11
    invoke-direct {p0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->r()V

    return-void
.end method

.method public a(I)V
    .locals 1

    .line 12
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    invoke-virtual {v0, p1}, Landroid/text/TextPaint;->setColor(I)V

    return-void
.end method

.method public a(Lcom/esfile/screen/recorder/videos/edit/activities/caption/font/a;)V
    .locals 1

    .line 2
    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->m:Lcom/esfile/screen/recorder/videos/edit/activities/caption/font/a;

    if-eqz p1, :cond_0

    .line 3
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    iget-object p1, p1, Lcom/esfile/screen/recorder/videos/edit/activities/caption/font/a;->a:Landroid/graphics/Typeface;

    invoke-virtual {v0, p1}, Landroid/text/TextPaint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;

    .line 4
    invoke-direct {p0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->r()V

    :cond_0
    return-void
.end method

.method public a(Ljava/lang/String;)V
    .locals 0
    .param p1    # Ljava/lang/String;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    .line 5
    iput-object p1, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->j:Ljava/lang/String;

    .line 6
    invoke-direct {p0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->r()V

    return-void
.end method

.method public b(F)V
    .locals 0

    return-void
.end method

.method public b(Landroid/graphics/Canvas;)V
    .locals 0

    .line 7
    invoke-super {p0, p1}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/a;->b(Landroid/graphics/Canvas;)V

    .line 8
    invoke-direct {p0, p1}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->c(Landroid/graphics/Canvas;)V

    return-void
.end method

.method public c(F)V
    .locals 1

    const/4 v0, 0x0

    .line 1
    invoke-direct {p0, p1, v0}, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->b(FZ)V

    return-void
.end method

.method public m()Ljava/lang/String;
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->j:Ljava/lang/String;

    return-object v0
.end method

.method public n()I
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    invoke-virtual {v0}, Landroid/text/TextPaint;->getColor()I

    move-result v0

    return v0
.end method

.method public o()F
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->k:Landroid/text/TextPaint;

    invoke-virtual {v0}, Landroid/text/TextPaint;->getTextSize()F

    move-result v0

    return v0
.end method

.method public p()Lcom/esfile/screen/recorder/videos/edit/activities/caption/font/a;
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/esfile/screen/recorder/videos/edit/activities/decor/f;->m:Lcom/esfile/screen/recorder/videos/edit/activities/caption/font/a;

    return-object v0
.end method
